<?php

namespace forfun\controller;

use forfun\service\QuestionService;
use restphp\http\RestHttpRequest;

/**
 * @RequestMapping ("/api/v1/questions")
 */
class ApiQuestionController extends ApiBaseController{
    /**
     * @Get ("")
     * @Logon
     * @return void
     */
    public function getList() {
        $key = RestHttpRequest::getPathValue('key');
        $page = RestHttpRequest::getRequest("page", 1);
        $this->_success(QuestionService::getQuestionList($key, $page));
    }
}